﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Text;
public partial class UserControl_Slide_ucBannerSlide : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
           lblHotTours.Text = SliderHotTours();
        }

        private string SliderHotTours()
        {
            try
            {
                string sql = "Select ID,noidung,Url,link from quangcao ";
                clsBSDungChung bs = new clsBSDungChung();
                DataTable tbImage = new DataTable();
                tbImage = bs.GetDataTableSQL(sql, "Cruises");
                StringBuilder menu = new StringBuilder();
               
               menu.Append("<div id=\"sliderN\">");
                for (int i = 0; i < tbImage.Rows.Count; i++)
                {
                    menu.Append("<a href=\"" + tbImage.Rows[i][3].ToString() + "\" target=\"_blank\" ><img src=\"" + tbImage.Rows[i][2].ToString().Remove(0, 2) + "\" title=\"" + tbImage.Rows[i][1].ToString() + "\" width='449px' height='154px' /></a>");
                }
                menu.Append("</div>");
               
                return menu.ToString();
            }
            catch
            {
                throw;
            }
        }
    }
